/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	CSCameraControlFreeRoam.h
*
*	Description -	Native script for the basic first-person control with keyboard and mouse.
*
*	Comments	-	Mouse for looking and WASD key for movement
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	06/15/2013	-	Creation of this file
**************************************************************************************/
#ifndef _PSX_COMPONENT_NATIVE_SCRIPT_CAMERA_CONTROL_FREE_ROAM_H_
#define _PSX_COMPONENT_NATIVE_SCRIPT_CAMERA_CONTROL_FREE_ROAM_H_

#include "PulseSTD.h"
#include "ComponentNativeScript.h"
#include "Vector3.h"
#include "Vector2.h"

namespace Pulse
{
	class CSCameraControlFreeRoam: public INativeScript< CSCameraControlFreeRoam >
	{
	public:

		CSCameraControlFreeRoam( ComponentNativeScript *pComponentOwner );

		virtual ~CSCameraControlFreeRoam( void );

	protected:

		// Methods that the derived script classes needs to define
		///////////////////////////////////////////////////////////

		virtual EErrorCode::Type OnScriptInitialize( void );
		
		virtual void OnScriptDestroy( void );

		virtual void OnScriptUpdate( FLOAT dt );

	private:

		// Input system delegates
		//////////////////////////

		void OnKeyUp( IEvent *pEvent );

		void OnKeyDown( IEvent *pEvent );

		void OnMouseMove( IEvent *pEvent );

		void OnMouseButtonUp( IEvent *pEvent );

		void OnMouseButtonDown( IEvent *pEvent );

	private:

		BOOL	m_bMove;
		BOOL	m_bKeyW;
		BOOL	m_bKeyA;
		BOOL	m_bKeyS;
		BOOL	m_bKeyD;
		BOOL	m_bKeyQ;
		BOOL	m_bKeyE;
		FLOAT	m_moveSpeed;
		FLOAT	m_rotationSpeed;
		Vector3 m_speed;
		Vector3 m_rotation;

	};
}

#endif /* _PSX_COMPONENT_NATIVE_SCRIPT_CAMERA_CONTROL_FREE_ROAM_H_ */